﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:Controls="clr-namespace:Prometheus.Binding.Validation">
    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="/Prometheus.Binding;component/ErrorToolTipTemplate.xaml"/>
    </ResourceDictionary.MergedDictionaries>
    <Style TargetType="Controls:proErrorBorder">
        <Setter Property="ToolTip.Template" Value="{StaticResource ValidationToolTipTemplate}"/>
        <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Controls:proErrorBorder">
                    <Border BorderThickness="1" UseLayoutRounding="True"
                            ToolTipService.ToolTip="{TemplateBinding ToolTip}" BorderBrush="{TemplateBinding BorderBrush}" Margin="-1">
                        <Grid>
                            <ContentPresenter Content="{TemplateBinding Content}"
                                              ContentTemplate="{TemplateBinding ContentTemplate}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                              VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Margin="{TemplateBinding Padding}" />
                            <Polyline Fill="{TemplateBinding BorderBrush}" HorizontalAlignment="Right"
                                      VerticalAlignment="Top">
                                <Polyline.Points>
                                    <Point X="0" Y="0" />
                                    <Point X="4" Y="0" />
                                    <Point X="4" Y="4" />
                                    <Point X="0" Y="0" />
                                </Polyline.Points>
                            </Polyline>
                        </Grid>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>